package cn.dataling.dag.repository;

import cn.dataling.dag.pojo.DagWorkflow;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public class DagWorkflowRepositoryInMemory implements DagWorkflowRepository {

    private static final List<DagWorkflow> DAG_ENGINES = new CopyOnWriteArrayList<>();

    @Override
    public Integer save(DagWorkflow dagEngine) {
        DAG_ENGINES.add(dagEngine);
        return 1;
    }

    @Override
    public Integer updateById(DagWorkflow dagEngine) {
        return null;
    }

    @Override
    public List<DagWorkflow> getDagWorkflowList() {
        return DAG_ENGINES;
    }
}
